package alp.starcode.nudtportal.framework.mybatis.dao.impl;

import alp.starcode.nudtportal.framework.mybatis.entity.VersionNoticeRead;
import alp.starcode.nudtportal.framework.mybatis.mapper.VersionNoticeReadMapper;
import alp.starcode.nudtportal.framework.mybatis.dao.VersionNoticeReadDao;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * version_notice_read(版本通知已读表) 服务实现类
 * </p>
 *
 * @author xwx
 * @since 2023-08-08
 */
@Service
public class VersionNoticeReadDaoImpl extends MPJBaseServiceImpl<VersionNoticeReadMapper, VersionNoticeRead> implements VersionNoticeReadDao {

    /**
     * 根据用户id查询版本通知已读表
     *
     * @param userId 用户id
     * @return
     */
    @Override
    public VersionNoticeRead getByUserId(String userId) {
        return getOne(new LambdaQueryWrapper<VersionNoticeRead>().eq(VersionNoticeRead::getUserId, userId));
    }
}
